package 夏洛克和他的女朋友;

import java.util.Scanner;

public class Main {
    static int N = 100010, cnt;
    static boolean[] st = new boolean[N];
    static int[] pr = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        init(n + 1);
        if (n <= 2) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
        for (int i = 2; i <= n + 1; i++) {
            if (!st[i]) {
                System.out.print(1+" ");
            } else {
                System.out.print(2+" ");
            }
        }
    }

    private static void init(int n) {
        for (int i = 2; i <= n; i++) {
            if (!st[i]) {
                pr[cnt++] = i;
            }
            for (int j = 0; pr[j] <= n / i; j++) {
                st[pr[j] * i] = true;
                if (i % pr[j] == 0) {
                    break;
                }
            }
        }
    }
}
